package com.yuncheng.spcyApi.controller;

import com.yuncheng.spcyApi.alog.annotation.Log;
import com.yuncheng.spcyApi.busService.WjStatService;
import com.yuncheng.vo.HttpResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

@Api(tags = "问卷相关统计")
@RestController
@RequestMapping("/api/spzx-spcy/wjStat")
public class WjStatController {
    @Resource
    private WjStatService wjStatService;

    @Log(title = "查询问卷题目统计数量")
    @ApiOperation(value = "查询问卷题目统计数量")
    @GetMapping(value = "queryWjtmStatCount")
    public HttpResult queryWjtmStatCount(@RequestParam(value = "id",defaultValue = "")String id){

        return HttpResult.ok(wjStatService.queryWjStat(id));
    }

    @Log(title = "导出-问卷题目统计数量")
    @ApiOperation(value = "导出-问卷题目统计数量")
    @GetMapping(value = "exportWjtmStatCount")
    public void exportWjtmStatCount(@RequestParam(value = "id",defaultValue = "")String id, HttpServletResponse response){
        wjStatService.exportWjStat(id, response);
    }

}
